package com.org.Bibliotech;

/**
 * Created by Joshua on 6/8/2014.
 */
public class Movie {
    private String title, director;
    private int releaseYear, rating;

    public Movie(String title, int releaseYear, String director, int rating){

        this.title = title;
        this.releaseYear = releaseYear;
        this.director = director;
        this.rating = rating;

    }



    public String getTitle(){
        return title;
    }

    public int getReleaseYear(){
        return releaseYear;
    }

    public String getDirector(){
        return director;
    }

    public int getRating(){
        return rating;
    }

    public String getDetails(){
       return "Title: " + title + '\n' +
                "Release Year: " + releaseYear + '\n' +
                "Director: " + director + '\n' +
                "Rating: " + rating;
    }





    public boolean equals(Object _movie){

        Movie movie;
        try{
            movie = (Movie)_movie;
        }catch(Exception e){
            return false;
        }

        return  title.equals(movie.getTitle()) &&
                releaseYear == movie.getReleaseYear() &&
                director.equals(movie.getDirector()) &&
                rating == movie.getRating();
    }


}
